package com.maven.booksystem.controller;


import com.maven.booksystem.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;


@Controller
@RequestMapping("/user")
public class UserController {
    // 这里是 从 IoC 容器中 取数据
    @Autowired
    UserService userService;

    @ResponseBody
    @RequestMapping("/login")
    public boolean login(String username, String password, HttpSession session) {
        return  userService.checkUser(username,password,session);
    }


}
